//
//  PartnerStyleVC.m
//  MyBlock
//
//  Created by YuanJiang on 2019/9/4.
//  Copyright © 2019 YuanJiang. All rights reserved.
//

#import "PartnerStyleVC.h"

@interface PartnerStyleVC ()

@end

@implementation PartnerStyleVC

- (void)viewDidLoad {
    [super viewDidLoad];
    
}

-(void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event
{
    [self getDataWithTime:^(NSString *str) {
        NSLog(@"%@",str);
    } failure:^(NSString *str1) {
        NSLog(@"%@",str1);
    }];
}



- (void)getDataWithTime:(void(^)(NSString *))success failure:(void(^)(NSString *))failure
{
    NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
    [formatter setDateFormat:@"yyyy-MM-dd"];
    NSDate *date = [NSDate date];
    NSString *dateStr = [formatter stringFromDate:date];
    if(date){
        if(success){
            success(dateStr);
        }
    }else{
        if (failure) {
            failure(@"获取当前时间失败哦");
        }
    }
}

@end
